module.exports = {
  nav_name: '商机管理', //生成导航菜单
  module_name: 'chance_manager',  //生成路径，与模块名相同
  api: `{
    page: commonPath + "/admin/needinfo/page", // 分页
    detail: commonPath + '/admin/needinfo/get', //详情,
    changeState: commonPath + '/admin/needinfo/editState', //添加
  }`,
  table: {
    nav_name: "商机列表",
    tipsText: "商机管理 >> 商机列表",
    //获取列表页面
    tableData: [
      { title: '序号', name: 'index', type: "normal" },
      { title: '用户昵称', name: 'userName', type: "normal", showObj: "{}" },
      { title: '标题', name: 'title', type: "normal", showObj: "{}" },
      { 
        title: '状态', 
        name: 'state', 
        type: "opts", 
        showName: "stateShow",
        showObj: `{
          "1": "待审核",
          "2": "审核通过",
          "3": "已拒绝",
        }` 
      },
      { title: '发布时间', name: 'gmtModified', type: "normal", showObj: "{}" },
    ],
    tableOpt: [
      {
        type: "view",
        text: "查看",
        request: false,
        jump: "/chance_manager_chance_detail"
      },
      {
        type: "changeState",
        text: "通过",
        request: true,
        url: "API.chance_manager.changeState",
        requestType: 'post',
        params: `{ state: 2, id }`, //id为必传项
        methodNameTag: 'Pass', //方法衔接拓展名 用于标志不同方法
        showCondition: "scope.row.state == '1'", 
      },
      {
        type: "changeState",
        text: "拒绝",
        request: true,
        url: "API.chance_manager.changeState",
        requestType: 'post',
        params: `{ state: 3, id }`,  //id为必传项
        methodNameTag: 'Reject', //方法衔接拓展名 用于标志不同方法
        showCondition: "scope.row.state == '1'", 
      },
    ],
    search: {
      contentArr: {
        input1: { labelName: '用户昵称', inputName: 'userName' },
        select1: {
          labelName: '状态',
          inputName: 'state',  //输入绑定的变量
          selectOptsName: "stateOpts",
          selectOptsArr: `[
            { value: "1", label: "待审核" },
            { value: "2", label: "审核通过" },
            { value: "3", label: "审核拒绝" },
            { value: "", label: "全部" },
          ],
          `, //选项数组
        },
      },
      searchBtn: {
        text: "查询", //链接与table请求接口相同，不做另外配置
      },
    },
  },



    //商机详情
    detail_page1: {
      detail_page_name: "chance_detail",
      detail_api: "API.chance_manager.detail",
      request_params : `{
        id,
      }`,
      tipsText: "商机管理 >> 商机详情",
      formData: {
        // titleText: "请填写管理员相关信息",
        item1: {
          labelName: '需求详情',
          inputName: 'need',
          type: "normal",
          frontTips: "", //后面的说明
          behindTips: "", //前面的说明
        },
        item2: {
          labelName: '需求图片',
          inputName: 'img',
          type: "img",
        },
        item3: {
          labelName: '标题内容',
          inputName: 'title',
          type: "normal",
          frontTips: "", //后面的说明
          behindTips: "", //前面的说明
        },
        // item4: {
        //   labelName: '行业类型',
        //   inputName: 'companyName',
        //   frontTips: "", //后面的说明
        //   behindTips: "", //前面的说明
        // },
        item5: {
          labelName: '用户昵称',
          inputName: 'userName',
          frontTips: "", //后面的说明
          behindTips: "", //前面的说明
        },
        // item6: {
        //   labelName: '用户身份',
        //   inputName: 'courseContent',
        //   frontTips: "", //后面的说明
        //   behindTips: "", //前面的说明
        // },
        item7: {
          labelName: '发布时间',
          inputName: 'gmtModified',
          frontTips: "", //后面的说明
          behindTips: "", //前面的说明
        },
      },
  
      // //额外请求
      // extraRequest: {
      //   dataCode: [ 
      //     "courseTypeOpts"
      //   ],
      //   methodsCode: [
      //     {
      //       explainText: "课程类别获取", //说明
      //       type: "opts",  //表示选项类型格式，value, label
      //       methodName: "getCourseTypeData",
      //       api: "API.course_manager.course_sort_page",
      //       optsName: "courseTypeOpts",
      //       params: `{
      //         "pageIndex": 1,
      //         "pageSize": 100,
      //       }`,
      //       optsConfig: {
      //         label: "typeName",
      //         value: "id"
      //       }
      //     }
      //   ]
      // },
  
    }
}
